package org.geek4j.jms;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Geek4J
 * @description ActiveMQ listener
 */
@Slf4j
@Component
public class Receiver {

	/**
	 * When you receive a message, print it out, then shut down the application.
	 * Finally, clean up any ActiveMQ server stuff.
	 */
	@JmsListener(destination = "Geek4J", containerFactory = "jmsContainerFactory", concurrency = "1")
	public void receiveMessage(String message) throws Exception {
		log.error("Received <" + message + ">");
	}
}